//
//  HOStatusTableViewCell.m
//  微度报修
//
//  Created by foguo-mac-1 on 7/6/16.
//  Copyright © 2016 WeiDu. All rights reserved.
//

#import "HOStatusTableViewCell.h"
@interface HOStatusTableViewCell()
{
}
@end

@implementation HOStatusTableViewCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)initWithWidth:(CGFloat)width withHeight:(CGFloat)cellHeight
{
	UIView *lineView = [[[UIView alloc]
				 initWithFrame:CGRectMake(2 * HO_HORIZONAL_PADDING,
										  0,
										  1,
										  cellHeight)] autorelease];
	[lineView setBackgroundColor:UIColorFromRGB(0xcccccc)];
	[self.contentView addSubview:lineView];
	
	
	self.btn = [[[UIButton alloc]
						initWithFrame:CGRectMake(2 * HO_HORIZONAL_PADDING - 6,
												 10,
												 12,
												 12)] autorelease];
	[self.contentView addSubview:self.btn];
//	UIImage *img = nil;
	self.statusLbl = [[[UILabel alloc]
				  initWithFrame:CGRectMake(30,
										   11,
										   200,
										   22)] autorelease];
//	self.statusLbl.text = @"未受理";
	self.statusLbl.font = [UIFont systemFontOfSize:14];
	self.statusLbl.textColor = TEXT_COLOR_666666;
	[self.contentView addSubview:self.statusLbl];
	
	self.contentLbl = [[[UILabel alloc]
				   initWithFrame:CGRectMake(140,
											2,
											width - 100,
											22)] autorelease];
//	self.contentLbl.text = @"我们会尽快处理";
	self.contentLbl.font = [UIFont systemFontOfSize:14];
	self.contentLbl.textColor = TEXT_COLOR_666666;
	[self.contentView addSubview:self.contentLbl];
	
	self.timeLbl = [[[UILabel alloc]
				initWithFrame:CGRectMake(self.contentLbl.frame.origin.x,
										 self.contentLbl.frame.origin.y + self.contentLbl.frame.size.height,
										 width - 100,
										 22)] autorelease];
//	self.timeLbl.text = @"2016-06-13 22:02:24";
	self.timeLbl.font = [UIFont systemFontOfSize:13];
	self.timeLbl.textColor = TEXT_COLOR_666666;
	[self.contentView addSubview:self.timeLbl];
}

- (void)setHightLight:(BOOL)highlight
{
	if(highlight)
	{
		self.statusLbl.textColor = MAIN_COLOR_NORMAL;
		self.contentLbl.textColor = MAIN_COLOR_NORMAL;
		self.timeLbl.textColor = MAIN_COLOR_NORMAL;
		[self.btn setBackgroundImage:[UIImage imageNamed:@"ic_chakanzhuangtai_hui"] forState:UIControlStateNormal];
		[self.btn setBackgroundImage:[UIImage imageNamed:@"ic_chakanzhuangtai"] forState:UIControlStateNormal];
		[self.btn setBackgroundImage:[UIImage imageNamed:@"ic_chakanzhuangtai"] forState:UIControlStateNormal];
	}
	else
	{
		
		self.statusLbl.textColor = TEXT_COLOR_999999;
		self.contentLbl.textColor = TEXT_COLOR_999999;
		self.timeLbl.textColor = TEXT_COLOR_999999;
		self.contentLbl.text = @"";
		self.timeLbl.text = @"";
		[self.btn setBackgroundImage:[UIImage imageNamed:@"ic_chakanzhuangtai"] forState:UIControlStateNormal];
		[self.btn setBackgroundImage:[UIImage imageNamed:@"ic_chakanzhuangtai_hui"] forState:UIControlStateNormal];
		[self.btn setBackgroundImage:[UIImage imageNamed:@"ic_chakanzhuangtai_hui"] forState:UIControlStateNormal];
	}
}
@end
